package me.sdevil507.systemAssist.systemMessage.po;

import lombok.*;
import me.sdevil507.supports.jpa.BaseJpaSnowflakeIdEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 通知接收表  当用户登录 去查询是否有待接收的通知 防止僵尸用户 长时间不登录
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "system_message_receiver")
public class SystemMessageReceiverPo extends BaseJpaSnowflakeIdEntity {

    /**
     * 通知关系表主键
     */
    @Column
    private Long messageRelId;

    /**
     * 接收人id
     */
    @Column
    private Long receiveUserId;

    /**
     * 接收人部门(包含智库id  智库办部门id, 0代表当前用户权限下所有智库)
     */
    @Column
    private Long receiveDeptId;

    /**
     * 信息状态  0未读, 1已读
     */
    @Column
    private Integer messageReadState;

    /**
     * 已读时间
     */
    @Column
    private Date readTime;

    /**
     * 是否删除
     */
    @Column(nullable = false)
    @Builder.Default
    private Boolean isDel= false;

    /**
     * 接收时间
     */
    @Column
    @Builder.Default
    private Date createTime = new Date();

}
